"""检查钉钉配置"""
from config import settings

print("=" * 60)
print("钉钉配置检查")
print("=" * 60)
print(f"AppKey:    {settings.DINGTALK_APP_KEY}")
print(f"AppSecret: {settings.DINGTALK_APP_SECRET[:20]}...")
print(f"回调URL:   {settings.DINGTALK_REDIRECT_URI}")
print("=" * 60)

# 验证配置完整性
if not settings.DINGTALK_APP_KEY or settings.DINGTALK_APP_KEY == "":
    print("❌ AppKey 未配置")
elif not settings.DINGTALK_APP_SECRET or settings.DINGTALK_APP_SECRET == "":
    print("❌ AppSecret 未配置")
elif not settings.DINGTALK_REDIRECT_URI or settings.DINGTALK_REDIRECT_URI == "":
    print("❌ 回调URL 未配置")
else:
    print("✅ 配置完整，所有参数已填写")
    print()
    print("注意：")
    print("1. 确保钉钉开放平台配置的回调域名与上述回调URL一致")
    print("2. 企业内部应用需要使用正确的授权接口")
    print("3. 回调域名需要在钉钉后台-应用设置-回调域名中配置")

